//
//  MyOrderSCCell.swift
//  OnceNectar
//
//  Created by 吴凌 on 2018/6/27.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit

class MyOrderSCCell: UICollectionViewCell, BottomShadow, AddCornerUIRectCorner {

    @IBOutlet weak var img: UIImageView!
    @IBOutlet weak var price: UILabel!
    @IBOutlet weak var name: UILabel!
    @IBOutlet weak var iconImage: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func layoutSubviews() {
        super.layoutSubviews()
        setShadow(view: self, opacity: bottomShadowOpacity, size: bottomShadowOffset, color: UIColor.black, cornerradius: CORNERRADIUS)
        addCornerWithView(aView: self.contentView, aCorners: .allCorners, aSize: CGSize(width: CORNERRADIUS, height: CORNERRADIUS))
    }
    func setData(model: GoodsSCModel) -> Void {
        if let text = model.title {
            name.text = text
        }
        
        price.attributedText = NSMutableAttributedString.differentColorAndSizeString(first: (firstString: "￥", firstColor: ONColor.subTextColor, firstSize: 13), second: (secondString: model.price! as NSString, secondColor: ONColor.pirceLabelColor, secondSize: 16))
        let url:URL = appendUrl(suffix: model.image!)
        img.sd_setImage(with: url, completed: nil)
    }
    
}
